package yc.bluetooth.libvoice;

import android.os.Environment;

import java.util.HashMap;

/**
 * 作者：yeqianyun on 2020/3/19 16:29
 * 邮箱：1612706976@qq.com
 */
public class Cons {

    //设备类型 BLE BT3.0
    public static final boolean BLE = true;
    public static final boolean BT3 = false;
    //超时时间
    public static final long SCAN_OUT_TIME = 60000;  //扫描超时时间 ms
    public static final long PAIR_OUT_TIME = 15000;  //配对超时时间 ms
    public static final long CONNECT_OUT_TIME = 15000;  //连接超时时间 ms
    //遥控器设备--客户类型
    public static final int PATCH_BLE = 0;  //透传BLE
    public static final int VOICE_CONTROL_MI = 1;   //小米
    public static final int VOICE_CONTROL_JIN = 2;  //金桔

    //服务UUID
    public static final String SERVICE_UUID = "0000fff0-0000-1000-8000-00805f9b34fb";
    //专门用于标识开始传数据和结束传语音发送的标志  01—开始，02—结束
    public static final String NOTIFY_FLAG_UUID = "0000fff1-0000-1000-8000-00805f9b34fb";
    //传输过来的语音数据
    public static final String NOTIFY_MESS_UUID = "0000fff2-0000-1000-8000-00805f9b34fb";
    //写入数据 发送01，让语音遥控器切换语音传输通道
    public static final String WRITE_FLAG_UUID = "0000fff3-0000-1000-8000-00805f9b34fb";

    //MSG_REPO_UI_STRING_NOTIFY  类型
    public static final int UI_STRING_NOTIFY_LEVEL_DEBUG = 0; //黑色
    public static final int UI_STRING_NOTIFY_LEVEL_INFO = 1;  //绿色

    //语音文件所在目录，此处必须获取系统的绝对路径，否则有时候会找不到  /storage/emulated/0/AVoiceControl
    public static final String PATH_VOICE_LOCAL= Environment.getExternalStorageDirectory().getAbsolutePath() + "/AVoiceControl";


    //Messenger通讯
    //初始化蓝牙
    public static final int MSG_INIT_BLUETOOTH = 0xFF;

    //扫描
    public static final int MSG_SCAN = 0x01;
    public static final int MSG_REPO_SCAN_DEVICE = 0x02;
    public static final int MSG_REPO_SCAN_FINISHED = 0x03;
    public static final int MSG_REPO_SCAN_OUT_TIME= 0x04;
    //停止扫描
    public static final int MSG_STOP_SCAN = 0x11;
    //连接
    public static final int MSG_PAIR_CONNECT= 0x21;
    public static final int MSG_REPO_PAIR_CONNECT_STATE = 0x22;
    public static final int MSG_DIS_PAIR_DISCONNECT= 0x23;
    //开始语音接收播报
    public static final int MSG_START_VOICE = 0x31;
    //操作结果通知界面
    public static final int MSG_REPO_UI_STRING_NOTIFY = 0x41;
    public static final int MSG_REPO_SUCCESS = 0x42;
    public static final int MSG_REPO_ERROR= 0x43;


    ///////////////////////////////   VoiceService中   /////////////////////////////////////
    //Handler
    public static final int HANDLER_BT_OPENED = 0x100;  //蓝牙已打开
    public static final int HANDLER_BT_CLOSED = 0x101;  //蓝牙已关闭
    public static final int HANDLER_PAIR_SUCCESS = 0x102;  //配对成功
    public static final int HANDLER_DIS_PAIR_SUCCESS = 0x103;  //解除配对成功
    public static final int HANDLER_CONNECT_SUCCESS = 0x104;  //连接成功
    public static final int HANDLER_DISCONNECT_SUCCESS = 0x105;  //断开连接
    public static final int HANDLER_SET_MTU_SUCCESS = 0x106;  //申请MTU成功
    public static final int HANDLER_RECEIVE_FLAG_SUCCESS = 0x107;  //接收FLAG成功（语音数据开始接收、结束接收标志）
    public static final int HANDLER_RECEIVE_MESS_SUCCESS = 0x108;  //接收MESS成功（语音数据）
    public static final int HANDLER_SEND_CHANGE_HID_GATT_SUCCESS = 0x109;  //发送01成功
    public static final int HANDLER_AUTO_PLAY_WAV_VOICE = 0x110;  //自动语音播报



}
